package com.kevin.serial;

import com.kevin.constant.SerialType;

import java.util.HashMap;

public class SerializerManager {

    private static HashMap<Byte,ISerializer> SerializerManagerMap = new HashMap<>();
    static {
        SerializerManagerMap.put(SerialType.SERIAL_JAVA.getSerialType(),new JavaSerializer());
        SerializerManagerMap.put(SerialType.SERIAL_JSON.getSerialType(),new JsonSerializer());
    }

    public static ISerializer getSerializer(byte code){
        return SerializerManagerMap.get(code);
    }
}
